import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;

public class Test {
    public static Object locker = new Object();
    public static void main(String[] args) throws InterruptedException {
/*        for (int i = 0; i < 10; i++) {
            int id = i;//事实 final 变量
            Thread t = new Thread(() -> {
                System.out.println("hello" + " i = " + id);
            });
            t.start();
        }*/

        Runnable r = new Runnable() {
            @Override
            public void run() {
                System.out.println("hello");
            }
        };

        Runnable run = () -> {
            System.out.println("hello");
        };



       /* ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 2, 500000, 1000,
                new ArrayBlockingQueue<>(10), DefaultThreadFactory ,new ThreadPoolExecutor.AbortPolicy());*/
        Thread t = new Thread(() -> {
           if(true) {
               synchronized (locker) {
                   try {
                       locker.wait();
                   } catch (InterruptedException e) {

                   }
                   System.out.println("hello");

               }
           }

        });

        t.start();
        Thread.sleep(1000);
        /*synchronized (locker){
            locker.notify();
        }*/
        t.interrupt();
    }
}
